<?php
//推送核销状态
require_once 'sign.php';

// $timestamp = 1719889433;
$timestamp = time();
// 开发者填入自己的小程序 app_id
$appId = "ttdd96ab2b42a07b6d01";
$nonceStr = randStr(10);
$keyVersion = "3";
$url = "/api/apps/trade/v2/push_delivery";
$data = json_encode([

    "out_order_no" => "LD172025749566890bd76e1cc",
    "item_order_list" => [
        [
            "item_order_id" => "ots73884496775674289023271"
        ]
    ],
    "poi_info" => json_encode([
        "shop_name" => "测试",
        "ext_valid_shop_id" => "1",
        "valid_poi_id_str" => "11111"

    ])
]);
$byteAuthorization = getByteAuthorization($url, $data, $appId, $nonceStr, $timestamp, $keyVersion);
$res = sign_post('https://developer.toutiao.com/api/apps/trade/v2/push_delivery', $byteAuthorization, $data);
echo $res;
exit;